function [nii_img nii_struct] = loadniigz(niigzFilename)


% Gunzip .nii.gz file
niiFilename = gunzip(niigzFilename, fileparts(which(mfilename)));
niiFilename = niiFilename{1};

% Load .nii file in MATLAB
nii_struct = load_untouch_nii(niiFilename);
nii_img = nii_struct.img;

% Delete created .nii file
eval(['delete ' niiFilename]);